<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      const str = "hello jack5,hi Jack_2";

      console.log(str.replace("2", "*"));
      console.log(str.replace(/\D/g, "*")); //非数字
      console.log(str.replace(/\S/g, "+"));
      console.log(str.replace(/\W/g, "*"));
    </script>
  </body>
</html>
